
<p id="notice"><%= flash[:notice] %></p>

<div class="intro-cartasur">
 <h3><%= t 'cartasur.forums.posts.postsfor' %></h3>
 <%= @topic.name %>
</div>     
<br />
<div id="forums">

  <% if @topic.posts.blank? %>

      <%=  t 'cartasur.forums.posts.noposts' %>

  <% else %>
      <% for post in @postsminusreplies %>
          <div class="cartasur-post">
              <span class="left">
                <%= link_to post.user.login, cartasur_user_path(post.user)%><br />
                <%= distance_of_time_in_words_to_now post.created_at %> ago

              </span>
              <span class="right">
                <%= h(post.content) %> <br />  <br />

                <%= (post.replies.try(:size)).to_s << " "<< (t 'cartasur.forums.posts.replies') %>
                | <%= link_to (t 'cartasur.forums.posts.reply'), new_cartasur_forum_topic_post_path(@forum, @topic, post) %>
                <% if admin? %>
                    | <%= link_to (t 'cartasur.forums.destroy'), cartasur_forum_topic_post_path(@forum,@topic, post), :confirm => (t 'cartasur.forums.areyousure'), :method => :delete %> <br />
                <% end %>
                <% for replypost in post.replies  %>
                    <br /> <span class="left">
                        <%= link_to replypost.user.login, cartasur_user_path(replypost.user)%><br />
                        <%= distance_of_time_in_words_to_now post.created_at %> ago

                    </span>
                   <span class=" right reply">
                        <%= h(replypost.content) %> <br />

                      <%= link_to (t 'cartasur.forums.posts.reply'), new_cartasur_forum_topic_post_path(@forum, @topic, post) %>
                     <% if admin? %>| <%= link_to (t 'cartasur.forums.destroy'), cartasur_forum_topic_post_path(@forum,@topic, replypost), :confirm => (t 'cartasur.forums.areyousure'), :method => :delete %>
                     <% end %>
                    </span>
                <% end %>
              </span>
          </div>
      <% end %>
  <% end %>
</div>
<br />
<p><%= link_to (t 'cartasur.forums.newpost'), new_cartasur_forum_topic_post_path(@forum, @topic) %><br />
  <%= link_to (t 'cartasur.forums.backtotopics'), cartasur_forum_path(@forum)   %>
</p>